From 70fda74d27d9b55c9030932794daa25c1e6cf50d Mon Sep 17 00:00:00 2001 From: Factiven Date: Fri, 14 Apr 2023 00:14:12 +0700 Subject: Update 6th --- pages/api/auth/[...nextauth].js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'pages/api/auth/[...nextauth].js') diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index 571bfdb..b6eae53 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -1,15 +1,13 @@ import NextAuth from "next-auth"; import { GET_CURRENT_USER } from "../../../queries"; import { client } from "../../../lib/apolloClient"; -import crypto from "crypto"; import clientPromise from "../../../lib/mongodb"; import { MongoDBAdapter } from "@next-auth/mongodb-adapter"; -const jwtSecret = crypto.randomBytes(64).toString("hex"); - export const authOptions = { // Configure one or more authentication providers adapter: MongoDBAdapter(clientPromise), + secret: process.env.NEXTAUTH_SECRET, providers: [ { id: "AniListProvider", @@ -52,15 +50,9 @@ export const authOptions = { }, }, ], - secret: jwtSecret, session: { //Sets the session to use JSON Web Token strategy: "jwt", - cookie: { - // Set the cookie to be secure and HTTP-only - secure: true, - httpOnly: true, - }, }, callbacks: { async jwt({ token, user }) { -- cgit v1.2.3